0 CpxTRS
↳1 DependencyGraphProof (BOTH BOUNDS(ID, ID), 12 ms)
↳2 CpxTRS
↳3 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxWeightedTrs
↳5 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳6 CpxTypedWeightedTrs
↳7 CompletionProof (UPPER BOUND(ID), 0 ms)
↳8 CpxTypedWeightedCompleteTrs
↳9 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 0 ms)
↳10 CpxRNTS
↳11 CompleteCoflocoProof (⇔, 76 ms)
↳12 BOUNDS(1, 1)
f(f(x, y, z), u, f(x, y, v)) → f(x, y, f(z, u, v))
f(x, y, y) → y
f(x, y, g(y)) → x
f(x, x, y) → x
f(g(x), x, y) → y
f(x, x, y) → x
f(x, y, y) → y
f(x, y, g(y)) → x
f(g(x), x, y) → y
f(x, x, y) → x [1]
f(x, y, y) → y [1]
f(x, y, g(y)) → x [1]
f(g(x), x, y) → y [1]
f(x, x, y) → x [1]
f(x, y, y) → y [1]
f(x, y, g(y)) → x [1]
f(g(x), x, y) → y [1]
f :: g → g → g → g g :: g → g |
f(v0, v1, v2) → null_f [0]
null_f
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
null_f => 0
f(z, z', z'') -{ 1 }→ x :|: z' = x, z'' = y, x >= 0, y >= 0, z = x
f(z, z', z'') -{ 1 }→ x :|: x >= 0, y >= 0, z'' = 1 + y, z = x, z' = y
f(z, z', z'') -{ 1 }→ y :|: z'' = y, x >= 0, y >= 0, z = x, z' = y
f(z, z', z'') -{ 1 }→ y :|: z' = x, z'' = y, x >= 0, y >= 0, z = 1 + x
f(z, z', z'') -{ 0 }→ 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0
eq(start(V, V1, V2),0,[f(V, V1, V2, Out)],[V >= 0,V1 >= 0,V2 >= 0]). eq(f(V, V1, V2, Out),1,[],[Out = V3,V1 = V3,V2 = V4,V3 >= 0,V4 >= 0,V = V3]). eq(f(V, V1, V2, Out),1,[],[Out = V5,V2 = V5,V6 >= 0,V5 >= 0,V = V6,V1 = V5]). eq(f(V, V1, V2, Out),1,[],[Out = V7,V7 >= 0,V8 >= 0,V2 = 1 + V8,V = V7,V1 = V8]). eq(f(V, V1, V2, Out),1,[],[Out = V9,V1 = V10,V2 = V9,V10 >= 0,V9 >= 0,V = 1 + V10]). eq(f(V, V1, V2, Out),0,[],[Out = 0,V11 >= 0,V2 = V12,V13 >= 0,V = V11,V1 = V13,V12 >= 0]). input_output_vars(f(V,V1,V2,Out),[V,V1,V2],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. non_recursive : [f/4]
1. non_recursive : [start/3]
#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into f/4
1. SCC is partially evaluated into start/3
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations f/4
* CE 4 is refined into CE [8]
* CE 5 is refined into CE [9]
* CE 3 is refined into CE [10]
* CE 6 is refined into CE [11]
* CE 7 is refined into CE [12]
### Cost equations --> "Loop" of f/4
* CEs [8] --> Loop 7
* CEs [9] --> Loop 8
* CEs [10] --> Loop 9
* CEs [11] --> Loop 10
* CEs [12] --> Loop 11
### Ranking functions of CR f(V,V1,V2,Out)
#### Partial ranking functions of CR f(V,V1,V2,Out)
### Specialization of cost equations start/3
* CE 2 is refined into CE [13,14,15,16,17]
### Cost equations --> "Loop" of start/3
* CEs [17] --> Loop 12
* CEs [16] --> Loop 13
* CEs [14] --> Loop 14
* CEs [13,15] --> Loop 15
### Ranking functions of CR start(V,V1,V2)
#### Partial ranking functions of CR start(V,V1,V2)
Computing Bounds
=====================================
#### Cost of chains of f(V,V1,V2,Out):
* Chain [11]: 0
with precondition: [Out=0,V>=0,V1>=0,V2>=0]
* Chain [10]: 1
with precondition: [V=V1+1,V2=Out,V>=1,V2>=0]
* Chain [9]: 1
with precondition: [V=V1,V=Out,V>=0,V2>=0]
* Chain [8]: 1
with precondition: [V1+1=V2,V=Out,V>=0,V1>=0]
* Chain [7]: 1
with precondition: [V1=V2,V1=Out,V>=0,V1>=0]
#### Cost of chains of start(V,V1,V2):
* Chain [15]: 1
with precondition: [V>=0,V1>=0,V2>=0]
* Chain [14]: 1
with precondition: [V=V1,V>=0,V2>=0]
* Chain [13]: 1
with precondition: [V1+1=V2,V>=0,V1>=0]
* Chain [12]: 1
with precondition: [V1=V2,V>=0,V1>=0]
Closed-form bounds of start(V,V1,V2):
-------------------------------------
* Chain [15] with precondition: [V>=0,V1>=0,V2>=0]
- Upper bound: 1
- Complexity: constant
* Chain [14] with precondition: [V=V1,V>=0,V2>=0]
- Upper bound: 1
- Complexity: constant
* Chain [13] with precondition: [V1+1=V2,V>=0,V1>=0]
- Upper bound: 1
- Complexity: constant
* Chain [12] with precondition: [V1=V2,V>=0,V1>=0]
- Upper bound: 1
- Complexity: constant
### Maximum cost of start(V,V1,V2): 1
Asymptotic class: constant
* Total analysis performed in 74 ms.